package com.shuke.sk_worm.service.Impl;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shuke.sk_worm.Mapper.SkShopCookieMapper;
import com.shuke.sk_worm.domain.SkShopCookie;

import com.shuke.sk_worm.service.SkShopCookieService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class SkShopCookieServiceImpl extends ServiceImpl<SkShopCookieMapper, SkShopCookie>
    implements SkShopCookieService {

    @Autowired
    private SkShopCookieMapper skShopCookieMapper;


    public List<SkShopCookie> listShopCookie(){
        //Long now = DateUtil.parse(DateUtil.today()).getTime()/1000;
        return skShopCookieMapper.listShopCookie();
    }

    @Override
    public int insertData(SkShopCookie cookie){
        return skShopCookieMapper.insert(cookie);
    }

    public void deleteShopCookie(Integer insertTime){
        skShopCookieMapper.deleteShopCookie(insertTime);
    }


    public SkShopCookie getCookieByShopId(Long shopId){
        return skShopCookieMapper.getCookieByShopId(shopId);
    }
}
